package top.xiangqifu.springboot2_auth.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.xiangqifu.springboot2_auth.base.BaseDataResult;
import top.xiangqifu.springboot2_auth.entity.AuthInfo;
import top.xiangqifu.springboot2_auth.utils.AuthInfoUtils;

@RestController
@RequestMapping("/temp/test")
@Slf4j
public class TestAuthControl {

    @GetMapping("/auth")
    public BaseDataResult<AuthInfo> auth() {
        AuthInfo authInfo = AuthInfoUtils.authInfo();
        log.debug("登录用的id：{}",authInfo.getUserId());
        return BaseDataResult.ok("", authInfo);
    }
}
